package com.yang.newCustomersTransferBackProcess.dao;

import com.yang.newCustomersTransferBackProcess.pojo.TeamSubmissionRestrictions;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface TeamSubmissionRestrictionsDao extends JpaRepository<TeamSubmissionRestrictions, Integer>, JpaSpecificationExecutor<TeamSubmissionRestrictions> {

    @Query(value = "select * from team_submission_restrictions tsr where tsr.team_id in (select left(a.team_id, 6) from adviser a where a.id = ?1)", nativeQuery = true)
    TeamSubmissionRestrictions findTeamSubmissionRestrictions(int adviserId);
}
